package org.example.auth.service.impl;

import org.example.auth.domain.Role;
import org.example.auth.dto.RoleDTO;
import org.example.auth.mapper.RoleMapper;
import org.example.auth.service.IRoleService;
import org.example.base.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yinyang
 * @since 2024-05-30
 */
@Service
public class RoleServiceImpl extends BaseServiceImpl<Role> implements IRoleService {

    @Autowired
    private RoleMapper mapper;
    @Override
    public List<Long> queryPermissionById(Long id) {
        return mapper.queryPermissionById(id);
    }

    @Override
    public void auth(RoleDTO roleDTO) {
        mapper.deleteAuth(roleDTO.getId());
        mapper.auth(roleDTO);
    }
}
